//Accepted
#include <cstdio>

int rect[4];
int test=1;

bool read(){
	int sum = 0;
	
	for(int i=0;i<4;i++){
		scanf("%d", &rect[i]);
		sum+=rect[i];
	}
    return sum != 0;
}


void process(){
	int caio=0;
	int n;
	int x, y;
	int temp;
	
	scanf("%d", &n);
	for(int a=0;a<n;a++){
		scanf("%d", &x);
		scanf("%d", &y);
		if((x<=rect[2] && x>=rect[0]))
			if((y<=rect[1] && y>=rect[3]))
				caio++;
	}
	
    printf("Teste %d\n%d\n\n",test++, caio);
}

int  main(){
     
    while(read()){
        process();
    }
    return 0;
}

